<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:spring="http://www.springframework.org/tags"
                template="../../../layout/Template.xhtml">

    <ui:define name="menu">
        <ui:include src="${user.menu}"/>
    </ui:define>

    <ui:define name="title">
        <h:outputText value="#{resourceBundle.updateFieldWorkWelcome}"/>
    </ui:define>

    <ui:define name="content">
        <ui:fragment id="updateFieldWorkFragment">
            <rich:panel id="updateFieldWorkPanel" header="#{resourceBundle.updateFieldWorkWelcome}">
                <h:form id="updateFieldWorkForm">
                    <h:panelGrid id="updateFieldWorkGrid" columns="3">
                        <h:outputText value="#{resourceBundle.updateFieldWorkFormSubject}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.subject}"
                                     id="subject"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageSubject}"/>
                        <h:message for="subject" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormLinkSupport}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.linkSupport}"
                                     id="linkSupport"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageLinkSupport}"/>
                        <h:message for="linkSupport" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormLinkCorrection}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.linkCorrection}"
                                     id="linkCorrection"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageLinkCorrection}"/>
                        <h:message for="linkCorrection" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormContain}"/>
                        <rich:editor value="#{flowScope.currentFieldWork.contain}"
                                     id="contain"
                                     required="true"
                                     theme="advanced"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageContain}">
                            <f:param name="theme_advanced_toolbar_location" value="top"/>
                            <f:param name="theme_advanced_toolbar_align" value="left"/>
                        </rich:editor>
                        <h:message for="contain" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormCorrection}"/>
                        <rich:editor value="#{flowScope.currentFieldWork.correction}"
                                     id="correction"
                                     required="true"
                                     theme="advanced"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageCorrection}">
                            <f:param name="theme_advanced_toolbar_location" value="top"/>
                            <f:param name="theme_advanced_toolbar_align" value="left"/>
                        </rich:editor>
                        <h:message for="correction" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormStartTime}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.startTime}"
                                     id="startTime"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageStartTime}"
                                     converterMessage="#{resourceBundle.updateFieldWorkConverterMessageStartTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="startTime" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormEndTime}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.endTime}"
                                     id="endTime"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageEndTime}"
                                     converterMessage="#{resourceBundle.updateFieldWorkConverterMessageEndTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="endTime" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormDate}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.date}"
                                     id="date"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateFieldWorkRequiredMessageDate}"
                                     converterMessage="#{resourceBundle.updateFieldWorkConverterMessageDate}">
                            <f:convertDateTime pattern="dd/MM/yy" type="date"/>
                        </h:inputText>
                        <h:message for="date" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormDeadLineDate}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.deadLineDate}"
                                     id="deadLineDate"
                                     converterMessage="#{resourceBundle.updateFieldWorkConverterMessageDeadLineDate}">
                            <f:convertDateTime pattern="dd/MM/yy" type="date"/>
                        </h:inputText>
                        <h:message for="deadLineDate" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateFieldWorkFormDeadLineHour}"/>
                        <h:inputText value="#{flowScope.currentFieldWork.deadLineHour}"
                                     id="deadLineHour"
                                     converterMessage="#{resourceBundle.updateFieldWorkConverterMessageDeadLineHour}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="deadLineHour" style="color:red"/>

                    </h:panelGrid>

                    <h:messages globalOnly="true"/>

                    <h:panelGrid id="updateFieldWorkButtonGrid" columns="2">
                        <a4j:commandButton id="updateFieldWorkButtonUpdate" value="#{bundle.submitButton}"
                                           action="update"/>

                        <a4j:commandButton id="updateFieldWorkButtonReturn" value="#{bundle.cancelButton}"
                                           action="cancel"
                                           immediate="true"/>
                    </h:panelGrid>
                </h:form>
            </rich:panel>
        </ui:fragment>
    </ui:define>

</ui:composition>